import 'package:e_book/pages/theme/dark.theme.dart';
import 'package:e_book/pages/theme/light_theme.dart';
import 'package:flutter/material.dart';

class ThemeProvider with ChangeNotifier {
  ThemeData _themeData = lightMode;

  ThemeData get themeData => _themeData;

  bool get isDarkMode => _themeData == darkMode;

  set themeData(ThemeData themeData) {
    if (_themeData != themeData) {
      _themeData = themeData;
      notifyListeners();
    }
  }

  void toggleTheme() {
    themeData = isDarkMode ? lightMode : darkMode;
  }
}
